home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-25 | 58.5 KB | 1,442 lines |
- Subject: Motif FAQ (Part 2 of 6)
- Newsgroups: comp.windows.x.motif,comp.answers,news.answers
- From: ksall@cen.com (Ken Sall)
- Date: 11 Oct 1994 07:51:55 GMT
-
- Archive-name: motif-faq/part2
- Last-modified: OCT 10, 1994
- Posting-Frequency: monthly
- Organization: Century Computing, Inc.
- Version: 3.8
-
-
-
- -----------------------------------------------------------------------------
- Subject: 27) TOPIC: MOTIF and the WORLD WIDE WEB (WWW)
-
- -----------------------------------------------------------------------------
- Subject: 28) Where's an HTML version of the Motif FAQ on World Wide Web
- (WWW)?
-
- [Last modified: Sept 94]
-
- Answer: An automatically generated HTML version of this Motif FAQ can be found
- at WWW URL:
-
- http://www.cis.ohio-state.edu/hypertext/faq/usenet/motif-faq/top.html
-
- -----------------------------------------------------------------------------
- Subject: 29)* What are other interesting WWW URLs which are related to Motif?
-
- [Last modified: Oct 94]
-
- Answer:
-
- NOTE: This is only the beginning of a list which I hope will
- grow with your contributions.
-
- See http://www.x.org/
- for the X Consortium welcome document (which contains links to getting X
- source code, intro to the X Consortium, X Technical Conference, the public ftp
- file server (ftp.x.org), and more.
-
- See http://tommy.informatik.uni-dortmund.de/EXUG/EXUG.html
- for the EXUG (European X User Group) home page.
-
- See http://www.osf.org:8001
- for the OSF Home Page.
-
- See http://www.osf.org:8001/general/members.html
- for links to several OSF Sponsor and Member Web Servers.
-
- See http://www.osf.org:8001/motif/list_features.html
- for a "Complete list of 2.0 features".
-
- See http://www.osf.org:8001/motif/MotifFAQ.html
- for "OSF ANSWERS FREQUENTLY-ASKED OSF/MOTIF(R) QUESTIONS", including OSF/Motif
- Release 2.0 Questions, OSF/Motif Licensing. and OSF/Motif and the Common
- Desktop Environment.
-
- See http://riwww.osf.org:8001/ri-home.html
- for the OSF Research Institute home page.
-
- See http://nearnet.gnn.com/gnn/meta/internet/mkt/ora/center.html
- for O'Reilly & Associates, Inc.
-
- See http://freedom.lm.com/freedom.html
- for Freedom Software ("Everything under the Sun regarding Motif").
-
- See http://freedom.lm.com/review.html
- for Freedom Software's page with links to a review of Motif builders, list of
- Motif interface builders, commerical widgets, etc.
-
- See http://tommy.informatik.uni-dortmund.de/EXUG/FAQ.html
- for X11 related FAQs (X, Xt, Motif, Free widgets, OPEN LOOK, InterView,
- Fresco, etc.).
-
- See file://134.130.161.30/arc/pub/unix/html/motifcorner.html
- for Harry's Motif Programming Corner (tips and tricks, including code).
-
- See http://www.wri.com/~cwikla/widget.html
- for John L. Cwikla's Widget FAQ Home Page (Composite Widgets, Non-Composite
- Widgets, Motif 1.1 Compatible, Motif 1.2 Compatible, Athena Compatible, FWF
- Widget Set, By Author, Shareware Widgets, Commercial Widgets).
-
- See http://www.cs.cmu.edu:8001/afs/cs.cmu.edu/user/bam/www/toolnames.html
- for Brad A. Myers' `User Interface Software Tools' list (which is not limited
- to Motif tools).
-
- See http://www.eit.com/software/winterp/winterp.html
- for WINTERP 2.0 Home Page (Niels Mayer).
-
- See http://www.ics.com/
- for information about products sold by Integrated Computer Solutions.
- Included are product descriptions and lots of Frequently Asked questions (and
- answers!).
-
- See
- http://akebono.stanford.edu/yahoo/Computers/Operating_Systems/Windowing_Systems/X_Window_System/Motif/
- for a collection of links to Motif info (including some of the above).
-
- See http://www.cm.cf.ac.uk/Dave/X_lecture/X_lecture.html
- for David Marshall's Motif tutorial with source code and illustrations.
-
- See http://www.aiai.ed.ac.uk/~jacs/wxwin.html
- for wxWindows information (toolkit for platform-independent GUI programming in
- C++).
-
- -----------------------------------------------------------------------------
- Subject: 30)* Where can I get the HTML widget used in Mosaic?
-
- [Last modified: Oct 94]
-
- Answer:
-
- From Ken Sall (ksall@cen.com): The HTML (HyperText Markup Language) widget is
- part of the NCSA Mosaic source code, located in the directory: Mosaic/Mosaic-
- source at ftp.ncsa.uiuc.edu (URL: ftp://ftp.ncsa.uiuc.edu/Mosaic/Mosaic-
- source/ )
-
- For example, one version is: Mosaic-2.4.tar.gz. When you uncompress (gunzip)
- and untar the source, look in the directory libhtmlw for HTML.c, HTML.h,
- HTMLP.h, etc.
-
- For documentation, see
- http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/htmlwidget.html .
-
-
- For information on using Mosaic by remote control, see
- http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/remote-control.html
-
- Here are more details from ah627@FreeNet.Carleton.CA (Samuel Effah):
-
- To the numerous request for the NCSA HTML widget information.
-
- Everything not already copyrighted by CERN is copyrighted by NCSA (including
- the contents of the libhtmlw, libnet, libXmx, and src directories, but not
- including the contents of libdtm, which is entirely public domain). ...
-
- * The UI grants you (hereafter, Licensee) a license to use the Software *
- * for academic, research and internal business purposes only, without a *
- * fee. Licensee may distribute the binary and source code (if released) *
- * to third parties provided that the copyright notice and this statement *
- * appears on all copies and that no charge is associated with such *
- * copies. *
- * *
- ( you can read more about the copyright in the Mosaic source code ).
-
-
- Documentation on the HTML widget can be located at:
-
- http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/htmlwidget.html
- ( it's on the older version, I think Mosaic1.x )
-
- For starters, you can compile directory Mosaic2.4/libhtmlw for the widget.
- Using: To create widget:
- htlmWid = XtCreateManagedWidget( "htlmWid",
- htmlWidgetClass, parent,
- htlmArgs,
- XtNumber( htlmArgs ));
-
- Callback for anchors:
- XtAddCallback(htlmWid, WbNanchorCallback, htmlRef, NULL);
-
- where htmlRef() looks like:
-
- static void htmlRef(widget, client_data, call_data) Widget widget; XtPointer
- client_data; WbAnchorCallbackData* call_data; {
- buffer = readHTMLFile( call_data->href );
- XtVaSetValues( widget, WbNtext, buffer, NULL ); }
-
- where readHTMLFile() is
-
- char * readHTMLFile( in_file ) char *in_flie; {
- /* function to read a file and return its content, given
- the file's name */ }
-
-
- I think this is enough to start you off.
-
- Thanks to: Samuel Effah
-
- -----------------------------------------------------------------------------
- Subject: 31) TOPIC: BOOKS and JOURNALS
-
- -----------------------------------------------------------------------------
- Subject: 32) Is there a bibliography available?
-
- [Last modified: Sept 94]
-
- Answer: The X Bibliography, originally maintained by Ken Lee, is now
- maintained by Steve Mikes, uunet.uu.net!topgun!smikes. Steve regularly posts
- to comp.windows.x and ba.windows.x a list of reference books and articles on X
- and X programming. The X FAQ from comp.windows.x reproduces part of this
- list. The complete X bibliography is available via ftp from:
-
-
- ftp.x.org:/contrib/docs/Xbibliography.ps
- gatekeeper.dec.com:/pub/X11/R5-contrib/Xbibliography
-
- -----------------------------------------------------------------------------
- Subject: 33)* Is there a Motif tutorial?
-
- [Last modified: Oct 94]
-
- Answer: See http://www.cm.cf.ac.uk/Dave/X_lecture/X_lecture.html
- for a hypertext Motif tutorial (by David Marshall) with source code and
- illustrations.
-
- Marshall Brain at brain@adm.csc.ncsu.edu posted a set of simple and useful
- Motif tutorials.
-
- Jan Borchers <job@ira.uka.de> writes about his Xmtutor:
-
- A free version of "Xmtutor", a menu-driven Motif application that contains an
- interactive tutorial about programming with Motif with many executable
- examples, is available via anonymous ftp from ftp.uni-stuttgart.de, in:
- /pub/X11/programming/xmtutor-1.2/.
-
- Xmtutor is very useful to learn Motif easier than with a book, and it is a
- convenient Quick Reference and resource-settings testbed for Motif application
- developers.
-
- It has been tested on SUN Sparcs (SunOS 4.1) and DEC Alphas (OSF/1 1.3a), but
- should be working OK on most other Unix / X11R4/R5 / Motif 1.1/1.2 systems.
-
- The demo version contains all the information to get you started with Motif,
- and upon registration, which costs 49 DM, you get the complete tutorial,
- describing all widgets, other topics such as inter-client communication,
- Compound Strings, etc., as well as a formatted TeX file of the tutorial to
- print out, which gives you a complete book about Motif.
-
- -----------------------------------------------------------------------------
- Subject: 34)* What books are available for Motif programmers?
-
- [Last modified: Oct 94]
-
- Answer:
-
- NOTE: This answer is always "under construction". If you are the
- author of, or an avid fan of, a book not listed here, send mail
- to ksall@cen.com. Corrections especially regarding new editions
- and ISBN's would be greatly appreciated. Anyone have info on
- the Motif 2.0 editions of the Prentice-Hall books?
-
- First, we present the official books from OSF. Then we include an alphabetical
- listing of selected books. (See the following question for Xt and Xlib books.)
-
-
- The "official" OSF/Motif books are:
-
- OSF/Motif Programmers Guide, Prentice-Hall ISBN 13-640525-8 (Motif 1.0), ISBN
- 0-13-640681-5 (Motif 1.1), ISBN 0-13-643107-0 (Motif 1.2) (NB: This makes use
- of the demo programs that you get with a Motif source license. The programs
- are not included and may or may not be available on your system.)
-
- OSF/Motif Programmers Reference Manual, Prentice-Hall ISBN 13-640517-17 (Motif
- 1.0), ISBN 0-13-640616-5 (Motif 1.1), ISBN 0-13-643115-1 (Motif 1.2) You will
- need this for the system calls.
-
- OSF/Motif Style Guide, Prentice-Hall 13-640491-X (Motif 1.0), ISBN 0-13-
- 640673-4 (Motif 1.1), ISBN 13-643123-2 (Motif 1.2) You will need this to get
- some idea of how to write programs with the correct `look and feel'.
-
-
- Next is an alphabetical listing (by author) of a number of essential books not
- by OSF but in wide use. I will attempt to keep this list current if the
- authors (or their readers) send me updates as new editions become available.
-
- Barkakati, Nabajyoti, X Window System Programming, SAMS. ISBN 0-672-22750-9.
- This contains a section on Motif.
-
- Berlage, Thomas Berlage, OSF/Motif: Concepts and Programming, Addison-Wesley,
- UK, 1991. ISBN 0-201-55792-4.
-
- Ferguson, Paula & Brennan, David, Motif Reference Manual, Volume 6B, O'Reilly
- & Associates, 1st Edition June 1993, 920 pages, ISBN: 1-56592-038-4. "Dan
- Heller's Motif Programming Manual [Volume 6A, below] has long been considered
- the most authoritative and insightful work on Motif. Now, with the addition of
- this companion reference manual, programmers can dispense completely with the
- original OSF documentation. In addition to covering the entire Motif toolkit,
- this book also covers OSF's "User Interface Language" or UIL, and the Motif
- Resource Manager (MRM) functions used to tie together applications with user
- interfaces defined in UIL."
-
- Flanagan, David, Motif Tools: Streamlined GUI Design and Programming with the
- Xmt Library, O'Reilly & Associates, 1st Edition August 1994, 1024 pages, ISBN:
- 1-56592-044-9. "Motif Tools and the Xmt programming library that accompanies
- it on CD-ROM offer resources to empower Motif programmers and dramatically
- speed up application development with the X Toolkit and Motif. The Xmt
- library contains nine custom widgets and over 250 convenience routines that
- handle many tricky aspects of GUI programming. The Layout widget, for example,
- is an incredibly flexible manager widget that makes the confusing and awkward
- Motif Form widget a thing of the past. And a single Menu widget will create an
- entire pulldown menu system for your application by reading a special menu
- description from a resource file or your C code. Other features of the library
- dramatically simplify the use of Motif XmStrings, automate the transfer of
- data between the fields of an application's data structures and the widgets of
- its dialog boxes, and make it possible to automatically create a widget
- hierarchy completely described in a resource file."
-
- Heller, Dan, Ferguson, Paula M. & Brennan, David, Motif Programming Manual,
- Volume 6A, O'Reilly & Associates, 2nd Edition February 1994, ISBN: 1-56592-
- 016-3. "The Motif Programming Manual describes how to write applications
- using the Motif toolkit from the Open Software Foundation (OSF). The book goes
- into detail on every Motif widget class, with useful examples that will help
- programmers to develop their own code. Anyone doing Motif programming who
- doesn't want to have to figure it out on their own needs this book." Although
- updated for Motif 1.2, it is still usable with Motif 1.1.
-
- Johnson, Eric F. and Kevin Reichard, Power Programming Motif, second edition,
- MIS: Press, New York, NY, 1993. ISBN 1-55828-322-6.
-
- Johnson, Eric F. and Kevin Reichard, Professional Graphics Programming in the
- X Window System, MIS: Press, New York, NY, 1993. ISBN 1-55828-255-6. This
- book covers difficult topics such as combining non-default visuals and color
- overlay planes with Motif applications.
-
- Newmarch, Jan, The X Window System and Motif - A Fast Track Approach.
- Addison-Wesley, ISBN 0-201-53931-4. As the long-time maintainer of this Motif
- FAQ, Jan's book is bound to contain unusual and useful insights.
-
- O'Reilly and Associates publishes an entire series of books concerning
- different aspects of the X Window System, including a number of books about
- Motif, as well as books on Xlib, Xt, and PEX. In this FAQ, we list O'Reilly
- books by the authors' names. For a summary of all of O'Reilly's X11 series,
- see:
-
- ftp://ftp.x.org/contrib/docs/Xbibliography.OReilly
-
- As of this writing, however, the above list was somewhat out-dated.
- Therefore, telnet to gopher.ora.com, login as "gopher", select "Detailed
- Product Descriptions", and then "X". WWW users can open this URL:
-
- gopher://gopher.ora.com/11/descriptions/X
-
- Sebern, Mark "Building OSF/Motif Applications: A Practical Introduction". The
- ISBN is 0-13-122409-3. Prentice-Hall. The book uses a large, realistic Motif
- application (a program to make slides for presentations) to demonstrate the
- use of Motif features. Both UIL and toolkit calls are discussed, though UIL is
- featured, both in the examples and in a reference chapter.
-
- Smith, Jerry, Designing X Clients with Xt/Motif, ISBN 1-55860-255-0 Morgan
- Kaufmann Publishers This adopts a higher-level approach to many of the objects
- that commonly occur in Motif but are not in the Motif API.
-
- Young, Douglas, "Object-Oriented Programming with C++ and OSF/Motif", Prentice
- Hall, 1992. ISBN 0-13-630252-1. Source code is
- ftp://ftp.x.org/contrib/book_examples/young.cxx.tar.Z
-
- Young, Douglas, "The X Window System: Programming and Applications with Xt,
- Motif Edition", Prentice Hall, 1994. ISBN 0-13-123803-5. This is the classic
- tutorial from 1989 updated for Motif 1.2. Source code is
- ftp://ftp.x.org/contrib/book_examples/young2.motif.tar.Z
-
- Young, Douglas, "Motif Debugging and Performance Tuning", Prentice Hall, 1995.
- ISBN 0-13-147984-9. Source code is
- ftp://ftp.x.org/contrib/book_examples/young.debug.tar.Z
-
- If you want to learn about UIL, one source is the "Motif Programmers's Guide"
- from Prentice-Hall. However, excellent UIL coverage appears in the O'Reilly
- and Associates books "Motif Programming Manual, Volume 6A" by Dan Heller and
- Paula M. Ferguson and in "Motif Reference Manual, Volume 6B" by Paula M.
- Perguson with UIL Material by David Brennan. (Yes, 6A and 6B were worth the
- wait!)
-
- -----------------------------------------------------------------------------
- Subject: 35)* Which Xt and X books would also be helpful?
-
- [Last modified: Oct 94]
-
- Answer: You will also need books and references on Xt and Xlib, such as:
-
- Asente, Paul J., and Swick, Ralph R., X Window System Toolkit, The Complete
- Programmer's Guide and Specification, Digital Press, 1990. The Xt bible. A
- treasury of information, excellent and invaluable. Distributed by Digital
- Press, ISBN 1-55558-051-3, Digital Press order number EY-E757E-DP; and by
- Prentice-Hall, ISBN 0-13-972191-6.
-
- Cutler, Ellie, Gilly Daniel, and O'Reilly, Tim, The X Window System in a
- Nutshell, O'Reilly & Associates, 2nd Edition April 1992, 424 pages, ISBN: 1-
- 56592-017-1. A quick reference guide to Xlib functions datatypes and events,
- Xt functions and datatypes, and the standard X clients. The second edition is
- expanded and covers X11R4 and X11R5.
-
- Flanagan, David, Programmer's Supplement for R5 of the X Window System,
- O'Reilly & Associates, 1991, ISBN: 0-937175-86-2. A programmer's guide to all
- the new features in X11R5, with reference pages for the new functions. [NOTE:
- This may be out-of-print since it is not listed at gopher.ora.com.]
-
- Flanagan, David, Editor, X Toolkit Intrinsics Reference Manual, Volume 5,
- O'Reilly & Associates, 3rd Edition April 1992, 916 pages, ISBN: 1-56592-007-4.
- "The X Toolkit Intrinsics Reference Manual is a complete programmer's
- reference for the X Toolkit. It provides reference pages for each of the Xt
- functions as well as the widget classes defined by Xt and the Athena widgets.
- This volume is based on Xt documentation from the X Consortium and has been
- re-edited, reorganized, and expanded... The third edition of Volume 5 has
- been completely revised. In addition to covering Release 4 and Release 5 of X,
- all the man pages have been completely rewritten for clarity and ease of use,
- and new examples and descriptions have been added throughout the book."
-
- Mui, Linda and Pearce, Eric, X Window System Administrator's Guide, Volume 8,
- O'Reilly & Associates, 1st Edition October 1992, CD-ROM Released May 1993,
- ISBN: 1-56592-052-X (with CD-ROM) "This book is the first and only book
- devoted to the issues of system administration for X and X-based networks,
- written not just for UNIX system administrators but for anyone faced with the
- job of administering X (including those running X on stand-alone
- workstations)..." A book for X system administrators, covering XDM, security,
- font management, X terminals, building X, etc. Available with a CD-ROM
- containing the complete X source code.
-
- Nye, Adrian, Xlib Programming Manual, Volume 1, O'Reilly and Associates, 3rd
- Edition July 1992, 824 pages, ISBN: 1-56592-002-3. "Updated to cover X11
- Release 5, the Xlib Programming Manual is a complete guide to programming the
- X library (Xlib), the lowest level of programming interface to X. It includes
- introductions to internationalization, device-independent color, font service,
- and scalable fonts. Includes chapters on: X Window System concepts, A simple
- client application, Window attributes, The graphics context, Graphics in
- practice, Color, Events, Interclient communication, Internationalization, The
- Resource Manager, A complete client application, Window management, and Other
- programming techniques."
-
- Nye, Adrian, Editor, Xlib Reference Manual, Volume 2, O'Reilly & Associates,
- 3rd Edition June 1992, ISBN 1-56592-006-6. Contains reference pages, derived
- from the MIT specification, for all Xlib functions. The third edition covers
- X11R4 and X11R5, including all the new internationalization and Xcms (Color
- Management System) functions.
-
- Nye, Adrian & O'Reilly, Tim, X Toolkit Intrinsics Programming Manual, Motif
- Edition, Volume 4M, O'Reilly and Associates, 2nd Edition August 1992, 674
- pages, ISBN: 1-56592-013-9. "Volume 4 is a complete guide to programming with
- the X Toolkit Intrinsics, the library of C language routines that facilitates
- the design of user interfaces with reusable components called widgets. It
- provides concepts and examples that show how to use the various X Toolkit
- routines. The first few chapters are devoted to using widgets; the remainder
- of the book covers the more complex task of writing new widgets. Volume 4 is
- available in two editions. The Motif Edition uses the Motif 1.2 widget set in
- examples, and covers X11 Release 5."
-
- Quercia, Valerie & O'Reilly, Tim, X Window System User's Guide, Motif Edition,
- Volume 3M, O'Reilly and Associates, 2nd Edition January 1993, 956 pages, ISBN:
- 1-56592-015-5. "The X Window System User's Guide, Motif Edition orients the
- new user to window system concepts and provides detailed tutorials for many
- client programs, including the xterm terminal emulator and the window manager.
- Building on this basic knowledge, later chapters explain how to customize the
- X environment and provide sample configurations. This alternative edition of
- the User's Guide highlights the Motif window manager, for users of the Motif
- graphical user interface. Revised for Motif 1.2 and X11 Release 5."
-
- Scheifler, Robert W., and Gettys, James, X Window System, The Complete
- Reference to Xlib, X Protocl, ICCCM, XLFD. Digital Press, 1992. The Xlib
- bible. Third edition covers X11R5. ISBN 1-55558-088-2, Digital Press order
- number EY-J802E-DP.
-
- For those interested in PHIGS and PEXlib, O'Reilly & Associates also publishes
- several books on these topics. See:
-
- gopher://gopher.ora.com/11/descriptions/3D
-
- -----------------------------------------------------------------------------
- Subject: 36)* What relevant journals are available?
-
- [Last modified: Oct 94]
-
- Answer:
-
- "The X Journal" is published bimonthly by SIGS Publications, 212-274-0640.
- Editorial information: editors%topgun@uunet.uu.net, editors@unx.com.
-
- "The X Resource: A Practical Journal of the X Window System" is published
- quarterly by O'Reilly and Associates, 800-998-9938. Editorial information:
- Paula Ferguson (paula@ora.com). In addition to the valuable articles which
- appear in regular issues, the January issue of each year (issues 1, 5, 9,
- etc.) contains the proceedings of the Annual X Technical Conference sponsored
- by the X Consortium. An on-line Table of Contents per issue can be accessed
- via gopher. Telnet to gopher.ora.com, login as "gopher", select "Detailed
- Product Descriptions", and then "X Resource". Alternatively, the WWW URL is:
-
- gopher://gopher.ora.com/11/descriptions/XResource
-
- Source code examples published in "The X Resource" appear organized by issue
- in the directory:
-
- ftp://ora.com/pub/examples/xresource
-
-
- -----------------------------------------------------------------------------
- Subject: 37) TOPIC: MWM
-
- -----------------------------------------------------------------------------
- Subject: 38) What is the difference between Motif and mwm?
-
- Answer: mwm is a window manager. Motif itself is made up of four parts: a
- User-Interface Guideline, an API toolkit of `C' routines which helps in the
- building of applications which conform to the Guideline, the window manager
- mwm, and a language UIL which is designed to ease user interface development.
- In general mwm will run an application built with any X-windows API, and in
- general an application built using the Motif toolkit will run under any window
- manager.
-
-
- -----------------------------------------------------------------------------
- Subject: 39) Does anyone have an alternative set of 3-D defaults for a
- monochrome screen?
-
- Answer: This is obviously a matter of taste. Some alternatives suggested
- include
-
- !Benjamin Schreiber, bs@osf.osf.org, bs@cs.brandeis.edu
- Mwm*foreground: black ! Actually, when a window is
- Mwm*background: white ! deactivated, the background
- Mwm*backgroundPixmap: 50_foreground ! becomes white, insted of
- Mwm*topShadowPixmap: white ! 50% foreground (grey)
-
- Mwm*activeForeground: black
- Mwm*activeBackground: white
- Mwm*activeBackgroundPixmap: 50_foreground
- Mwm*activeTopShadowPixmap: white
-
- Mwm*menu*backgroundPixmap: background
- Mwm*menu*topShadowPixmap: 50_foreground
-
- Mwm*title*foreground: black
- Mwm*title*background: white
- Mwm*title*backgroundPixmap: white
- Mwm*title*topShadowPixmap: 50_foreground
- Mwm*title*activeForeground: white
- Mwm*title*activeBackground: black
- Mwm*title*activeBackgroundPixmap: black
- Mwm*title*activeBottomShadowPixmap: 50_foreground
-
- Mwm*feedback*backgroundPixmap: white
-
- or
-
- ! From: tsang@isi.com (Kam C. Tsang)
- Mwm*background: White
- Mwm*activeBackground: White
- Mwm*activeBackgroundPixmap: 25_foreground
- Mwm*foreground: Black
- Mwm*activeForeground: Black
- Mwm*menu*background: white
- Mwm*menu*foreground: black
- xterm*Foreground: black
- xterm*Background: white
-
-
- or
-
- ! From: ucsd.edu!usc!snorkelwacker!paperboy!yee (Michael K. Yee)
- Mwm*cleanText: True
-
- Mwm*activeBackground: white
- Mwm*activeForeground: black
- Mwm*background: white
- Mwm*foreground: black
-
- Mwm*client*activeBackgroundPixmap: 50_foreground
- Mwm*client*activeTopShadowPixmap: foreground
- Mwm*client*activeBottomShadowPixmap: background
-
- !Mwm*client*background: white
- !Mwm*client*foreground: black
- Mwm*client*backgroundPixmap: 75_foreground
- Mwm*client*topShadowPixmap: foreground
- Mwm*client*bottomShadowPixmap: background
-
- !Mwm*feedback*background: white
- !Mwm*feedback*foreground: black
- Mwm*feedback*backgroundPixmap: 50_foreground
- !Mwm*feedback*topShadowPixmap: 25_foreground
- !Mwm*feedback*bottomShadowPixmap: background
-
- !Mwm*menu*background: white
- !Mwm*menu*foreground: black
- Mwm*menu*backgroundPixmap: foreground
- !Mwm*menu*topShadowPixmap: foreground
- !Mwm*menu*bottomShadowPixmap: background
-
- !Mwm*icon*background: white
- !Mwm*icon*foreground: black
- Mwm*icon*activeBackgroundPixmap: 50_foreground
- Mwm*icon*activeBottomShadowPixmap: foreground
- Mwm*icon*backgroundPixmap: 75_foreground
-
-
- -----------------------------------------------------------------------------
- Subject: 40) How can I modify the Motif window manager decorations?
-
- Answer: In resource files, use the window manager's client resource (which is
- the application) and the resource clientDecoration:
-
-
- Mwm*XClock.clientDecoration: none
-
- turns off all clock decorations. See the mwm(1) entry for other
- possibilities.
-
- Programmatically, set the VendorShell resource XmNmwmDecorations to
- appropriate values: MWM_DECOR_NONE (or a bitwise or of values).
-
- -----------------------------------------------------------------------------
- Subject: 41) Is there an ICCCM compliant way of setting window manager
- decorations?
-
- Answer: Tom LaStrange (toml@LaStrange.COM) writes: "No, there is no ICCCM
- portable way to alter decorations." ----------
- -------------------------------------------------------------------
- Subject: 42) How can I turn off the Motif window manager functions from the
- system menu?
- [Last modified: October 92]
-
- Answer: The user of an application can control functions in the system menu
- for an application using the mwm resource clientFunctions:
-
- mwm.application_name.clientFunctions: -resize -close
-
- Note that mwm will have to be restarted after putting this in their resource
- database.
-
-
- Answer: The writer of an application can only remove items. Be warned that
- your users will probably gnash their teeth, swear furiously at your product
- and stop using it if they discover that you have done this. (Especially if
- you have removed the Close button, your application has hung and it has taken
- up all of memory and swap so it can't be killed.) Much better is to catch the
- action gracefully as in the next question.
-
- #include <Xm/MwmUtil.h>
-
- XtVaGetValues(shell, XmNmwmFunctions, &int_val, NULL);
- int_val &= ~(MWM_FUNC_CLOSE | MWM_FUNC_ALL);
- XtVaSetValues(shell, XmNmwmFunctions, int_val, NULL);
-
-
- -----------------------------------------------------------------------------
- Subject: 43) How can tell I if the user has selected the "Close" item on the
- system menu attached to the top-level shell? I need to do some clean up
- before exiting.
-
- [Last modified: May 93]
-
- Answer: This works with R4 Intrinsics
-
- #include <Xm/Protocols.h>
-
- void FinalCleanupCB(w, client_data, call_data)
- Widget w;
- caddr_t client_data, call_data;
- {
- /* tidy up stuff here */
- ...
- /* exit if you want to */
- exit (0);
- }
-
- main()
- {
- Atom wm_delete_window;
-
- ...
- XtRealizeWidget(toplevel);
- ...
- wm_delete_window =
- XmInternAtom(XtDisplay(toplevel),
- "WM_DELETE_WINDOW", False);
- XmAddWMProtocolCallback(toplevel, wm_delete_window,
- FinalCleanupCB, NULL);
- XtMainLoop();
- }
-
- This will still kill the application. To turn this behaviour off so that the
- application is not killed, set the shell resource XmNdeleteResponse to
- XmDO_NOTHING. This means that users cannot kill your application via the
- system menu, and may be a bad thing.
-
- If you are running R3, Bob Hays (bobhays@spss.com) has suggested this:
- "Trapping on the delete window atom does not work as I cannot force my action
- routine to the top of the action list for the activity desired, so the window
- manager kills my window anyway BEFORE I can do anything about it. And, to
- make matters worse, the window manager (Motif in this case) tacks its atoms
- and handlers onto the window at some unknown point down the line after the
- creation of the shell widget as far as I can tell. So....
-
- I have a procedure as an action routine for ClientMessage. Then, if I get a
- property change event on the window manager protocols, I then tack on
- WM_SAVE_YOURSELF. If I get this request, I clean up (it seems to happen on
- WM_DELETE_WINDOW, BTW, if you remove WM_DELETE_WINDOW from the WM protocols
- atom) and exit. Works great and is less filling overall:-)."
-
-
- -----------------------------------------------------------------------------
- Subject: 44)* Is there an mwm virtual desktop manager?
-
- Answer: Peter E. Wagner (pew@cs.brown.edu): Imagine that your "desktop"
- extends beyond the view provided by your monitor. A virtual window manager
- gives you access to the space beyond your viewport (i.e. your screen) by
- allowing you to move the viewport to other areas of the extended desktop.
-
- The first one is Solbourne's swm, which spawned vtwm/tvtwm/olvwm.
-
- David B. Lewis created one. suresh@unipalm.co.uk has further developed it
- into the UniPalm product DOORS, which is only available as a source code
- extension to the MOTIF window manager. The price of the source and unlimited
- right to distribute binaries is 10,000 pounds Sterling. Alternately, source
- and right to use within one company is 2,000 pounds Sterling. Contact Peter
- Dawe
-
- Unipalm Limited Voice: +44 (0) 223 420002
- 216 The Science Park Fax: +44 (0) 223 426868
- CAMBRIDGE
- CB4 4WA
-
- An enhancement request for such an object has been filed with OSF.
-
- Tim Failes (tim@aus.oz.au) of Advanced User Systems Pty Ltd writes: IXI has a
- fully supported product called Panorama which provides this facility.
- Panorama allows the user to pan around the virtual work space, dynamically
- change the size of the virtual workspace, and also access windows via an icon
- box. Panorama also includes a point-and-click tool for setting resources such
- as colours, focus policy, etc. [IXI contact information appears in the "Where
- can I get Motif?" subject. -ed]
-
- -----------------------------------------------------------------------------
- Subject: 45) Why does mwm 1.2 crash on startup?
-
- [Last modified: March 93]
-
- Answer: From David Brooks: The commonest cause of early mwm demise is as
- follows:
-
- - You, or someone, built Xlib in the default way using the Xsi
- internationalization functions.
-
- - Your Xlib wasn't installed completely (or at all).
-
- - Early on, mwm calls the function XmbTextListToTextProperty, which calls
- _XConvertMBToCT, which looks for the Xsi locale database, finds it
- missing, ignores this fact and tries to dereference zero.
-
- The workaround is to find the database *somewhere*, and point the environment
- variable XNLSPATH at it. For example, in my personal X source tree:
-
- setenv XNLSPATH /home/X11r5src/mit/lib/nls/Xsi
-
-
- -----------------------------------------------------------------------------
- Subject: 46) TOPIC: MOTIF DEVELOPMENT TOOLS (GUI BUILDERS and UIMS's)
-
- -----------------------------------------------------------------------------
- Subject: 47)* What tools exist to assist in developing Motif applications?
-
- [Last modified: Oct 94]
-
- Answer: [A FAQ is not for "personal opinions" on these tools. I don't think
- it is appropriate to give such opinions through this particular posting, so I
- haven't included any. I will include vendor-provided descriptions provided
- they are concise and informative. See Subject 0 for contribution details.]
-
- `Prototyping tools' and `code generation tools' come in two forms:
-
- GUI (Graphical User Interface) builder -
- those that can be used to design (and perhaps rehearse)
- the interface only ; and
-
- UIMS (User Interface Management Systems) -
- those that are a system supporting the development and
- execution of user interfaces.
-
- However, this distinction can be somewhat arbitrary when specific tools are
- categorized as either one or the other. (Therefore, the classification below
- should be taken with a kilogram of salt. :-)
-
- A number of commercial and non-commercial tools of both kinds that will
- support Motif are listed below. [NOTE: Vendors or individuals wishing to add
- their product or tool to this list, or to change their entry, should email to
- the maintainer of this FAQ.]
-
- GUI builders:
-
- Builder Xcessory (bx)
- Druid
- ExoCODE/xm
- iXBUILD (formerly X Build)
- MOTIFATION
- WKSH (Windowing Korn Shell)
- X-Designer
-
- UIMS:
-
- ALEX
- ezX User Interface Management System
- Galaxy
- MetaCard
- Serpent
- TAE Plus
- TeleUse
- UIMX
- Widget Creation Library (Wcl)
- WINTERP
- XFaceMaker2
-
-
- For users of the WWW, see also Brad A. Myers' `User Interface Software Tools'
- list (which is not limited to Motif tools):
- http://www.cs.cmu.edu:8001/afs/cs.cmu.edu/user/bam/www/toolnames.html
-
-
- Some contact addresses, presented in alphabetical order (without regard to GUI
- or UIMS categorization), follow:
-
-
- o ALEX: For more information contact Michael Karliner on (+44) 81 566 2307 or
- E-mail to alex@s-strat.co.uk. ALEX Technologies, Waterman's Yard, 32a The
- Mall, Ealing, London W5, UK.
-
-
- o Builder Xcessory (bx): is from ICS. More details are available by sending
- a request to info@ics.com. Address:
-
- ICS Inc.,
- 201 Broadway,
- Cambridge MA 02139,
- Tel. (617) 621-0060,
- Fax. (617) 621-9555
- http://www.ics.com/
-
-
- o Druid: is a commercial product. It currently supports Motif1.1 and 4 unix
- platforms: SPARC, HP 9000, RS6000, and SGI. For further information contact:
-
- Mr. Fred Lee,
- Automated Systems (Pte) Limited,
- 203 Henderson Road, #12-07/14,
- Henderson Industrial Park,
- Singapore 0315.
- FAX: (65)272-2029
-
-
- Or: Dr. Gurminder Singh (gsingh@iss.nus.sg), Institute of Systems Science,
- National University of Singapore
-
-
- o ExoCODE/xm: From Expert Object Corp., 7250 Cicero Avenue, Lincolnwood, IL
- 60646 (708)676-5555. Also: ExoCODE, EXOC, 500 Hyacinth Place, Highland Park,
- IL, 60035, (708) 926-8500, $1,500, Motif or OpenLook or SunView.
-
-
- o ezX: Contact information:
-
- ezX User Interface Management System
- Sunrise Software, International
- 170 Enterprise Center
- Middletown, RI 02840
- 401-847-7868
- email: support@sunrise.com
-
-
- o Galaxy, Visix Software Inc., 11440 Commerce Park Drive, Reston, VA, 22091,
- (800) 832-8668, $9,600, Mac, Windows, Motif, OpenLook; very complete, Virtual
- Toolkit, UIMS
-
-
- o iXBUILD (formerly X Build):
-
- iXOS Software GmbH,
- Bretonischer Ring 12,
- 8011 Grasbrunn/Munich, Germany,
- email support@ixos.de or office@ixos.de,
- phone ++49-89-46005 0
-
- or in the US:
-
- UniPress Software,
- 2025 Lincoln Hwy.,
- Edison, NJ 08817,
- phone 1-800-222-0550
-
-
- o MetaCard: MetaCard 1.0 is supported on five popular UNIX/X11 platforms:
- SPARC, Sun3, DECstation, HP-9000/300, and SCO ODT. An HP-9000/700 port is
- underway and should be available by the end of July. [They] plan to support
- IBM RS/6000, SGI Iris, and DG AViiON sometime fall '92. For more information,
- or to receive a free save-disabled but licensable copy of MetaCard, email to
- info@metacard.com or call 303- 447-3936. If you have anonymous FTP access to
- the Internet, you can download the current engines, documentation, and an
- unlicensed Home stack from ftp.metacard.com (128.138.213.21), directory
- MetaCard. Commercial users can get MetaCard from world.std.com
- (192.74.137.5), directory pub/Metacard. If you don't have an anonymous ftp
- access, you can also download MetaCard from The World using kermit or xmodem
- from the ~ftp/pub/MetaCard directory. Sign up by calling 617-739-0202 (voice)
- or via modem by dialing 617-739-9753 (7 bits even parity) and logging in as
- new.
-
- MetaCard 1.2 Beta 5 is now available for anonymous FTP from ftp.metacard.com
- (directory MetaCard/1.2B5), and ftp.uu.net (directory vendor/MetaCard/1.2B5).
-
- There is also a MetaCard mailing list. To subscribe to the metacard-list,
- send mail to listserv@grot.starconn.com with the following commands in the
- body of the message:
-
- subscribe metacard-list firstname lastname
- quit
-
- Replace "firstname lastname" with your name, not your e-mail address.
-
-
- o MOTIFATION: PEM GmbH, Vaihinger Strasse 49, 7000 Stuttgart 80, Germany,
- Tel: +49 (0) 711 713045, Fax: +49 (0) 711 713047 Email: basien@pem-
- stuttgart.de. Available for (Motif 1.2/1.1) on SunOS, Solaris 2.1, HP,
- Interactive, ODT 3.0, Silicon Graphics, PCS, ...
-
-
- o Serpent: The S/W is free (anonymous ftp) from ftp.sei.cmu.edu. For more
- info contact erik/robert at serpent-info@sei.cmu.edu. NOTE: This is no longer
- supported, and is apparently replaced by a commercial product called Alpha.
-
-
- o TAE Plus: TAE Plus is a mature, portable software development environment
- that supports rapid prototyping, tailoring, and management of Motif-based
- graphical user interfaces. It particularly supports GUI development by non-
- programmers and by programmers who are not well-versed in the details of X and
- Motif. Its code generator can produce C, C++, and Ada code and allows for
- automatic merging of regenerated code with previously modified parts of the
- interface code. It supports generation of a UIL/Mrm representation of the
- interface.
-
- Scripting capabilities are provided to facilitate automatic testing, on-line
- demos, and tutorials. A record and playback feature lets you build scripts
- simply by interacting with your GUI. Dynamic Data Objects allow the developer
- to create pictorial objects (e.g., a thermometer to show temperature), whose
- dynamic portions (e.g., the mercury in the themometer) can change to reflect
- changing data or be directly manipulated by the end-user. TAE Plus is
- available on Sun, HP, IBM, SGI, and SCO Unix platforms. Evaluation software
- is available via anonymous ftp.
-
- TAE Plus contact information:
-
- Century Computing, Inc.
- 1014 West Street
- Laurel, MD 20707
- 1-800-823-3228
- tae-info@cen.com
-
-
- o TeleUSE: Built around X Windows and OSF/Motif, TeleUSE's comprehensive
- toolset gives you maximum control over every phase of graphical user interface
- development, including static screen layout and design, automatic
- implementation of callbacks, building the executable, and the interactive
- test, debug, and maintenance cycles. For more information, please contact:
-
- In North America and countries not specified below:
-
- Alsys (formerly TeleSoft)
- 10251 Vista Sorrento Parkway Suite 300
- San Diego, CA 92121 USA
- (619) 457-2700 X244
- (619) 452-1334 (fax)
- leigh@alsys.com
-
- In France: +33 1 47 66 21 83
- In the UK: +49 491 579 090
- In Scandinavia: +46 8 520 69010
- In the Benelux: +31 15 62 21 21
- In Germany: +49 7531 65022
- In Italy: +39 6 5045 1
- In Japan: +81 3 522 85620
- In South Korea: +82 2 577 2044
-
-
- o UIMX:
-
- Visual Edge Software Limited
- 3870 Cote Vertu
- St Laurent, Quebec
- H4R 1V4
- Phone: (514) 332-6430
- Fax: (514) 332-5914
- or:
- Visual Edge Software Ltd.
- 101 First Street, Suite 443
- Los Altos, CA 94022
- Phone: (415) 948-0753
- Fax: (415) 948-0843
-
-
- o Widget Creation Library (Wcl): The distribution is available in several
- ways. The preferred approach it for you to get the compressed tar file using
- anonymous ftp from:
-
-
- ftp.x.org /R5contrib/Wcl-2.5.tar.Z
- WWW URL: ftp://ftp.x.org/R5contrib/Wcl-2.5.tar.Z
-
-
- o WINTERP: (Widget INTERPreter) An object-oriented rapid prototyping,
- development and delivery environment for building extensible applications with
- the OSF/Motif UI Toolkit and Xtango-based graphics/animation. By Niels Mayer
- (mayer@netcom.com). Mailing list: winterp-request@netcom.com. Available via
- ftp from ftp.x.org:/contrib/devel_tools/winterp-2.xx.tar.gz (where 'xx' is
- currently '03').
-
- Key WINTERP Features:
-
- * High-level, Object-oriented interface to OSF/Motif and Xtoolkit.
- * High-level object-oriented 2.5D graphics&animation widget based
- on Xtango path transition animation system.
- * Ability to easily create new widget classes w/ complex graphical
- behavior using Xtango animation/graphics.
- * Automatic storeage management of all X/Xt/Motif data, Pixmaps,
- animations. Automatic resource conversion and management.
- * Asynchronous communications w/ other unix programs via
- expect-based subprocess facility.
- * Includes XmGraph to display graphs (both cyclic, acyclic,
- directed, undirected); graph nodes can be arbitrary widgets
- created by WINTERP; supports direct manipulation editing of graph.
- * GIF image support.
- * Lisp-eval server architecture supports inter-application
- communication.
- * Interactive programming via Gnu-Emacs or Motif-Text-widget interface.
- * Portable, small, fast, and free.
-
-
- o WKSH (Windowing Korn Shell):
-
- EXtensible Korn Shell (C language calling interface,
- dynamic library loading, etc.)
- Motif or OpenLook API
- X Toolkit Intrinsics
- WKSH Convenience Functions
- Fast Learning and Prototyping Feature (ksh interpreter)
- Contact:
- Acacia Computer,
- PO Box 4376,
- Warren, NJ 07059,
- Phone: 908 548 6955,
- Email: uunet!aca1
-
-
- or: Computer Aid Inc, 1-(800)-444-WKSH, or:
-
-
- Consensys Corp,
- Europe: +(44)-734-833241 (Roger Chalke), +(44)0734-835391 (Fax),
- US: (416)-940-2903, (416)-940-2903 (Fax).
-
-
- WKSH was developed by USL. Binaries are available through Acacia Computer for
- SUNOS, Solaris, SCO ODT, Intel SVR4.0
-
-
- o X-Designer: From Imperial Software Technology in the UK. Email address is
- sales@ist.co.uk. (+44) 743 587055
-
- V.I. Corporation have become the distributor for the X-Designer product in the
- United States. In addition, IST and V.I. Corporation have developed a product
- called DVX-Designer that merges X-Designer with their GUI product called
- DataViews. Other merged products are in the works. For more information,
- people can contact:
-
- V.I. Corporation
- 47 Pleasant Street
- Northampton, MA 01060
- Phone: (413) 586-4144
- Fax: (413) 586-3805
- Email: vi@vicorp.com
-
-
- o XFaceMaker2:
-
- NSL - Non Standard Logics S.A.,
- 57-59, rue Lhomond,
- 75005 Paris - France,
- Phone: +33 (1) 43.36.77.50,
- Fax: +33 (1) 43.36.59.78
- email: requests@nsl.fr or requests%nsl.fr@inria.fr for information.
-
- Their North American office:
-
- Non Standard Logics, Inc.,
- 4141 State Street, Suite B-11,
- Santa Barbara CA 93110,
- Tel: 805 964 9599,
- Fax: 805 964 4367
-
- -----------------------------------------------------------------------------
- Subject: 48) TOPIC: GEOMETRY MANAGEMENT
-
- [NOTE: As you can see, this is a new topic area. Send me your ideas for
- answered questions pertaining to this topic.]
-
- -----------------------------------------------------------------------------
- Subject: 49) Why is geometry management so important?
-
- [Last modified: Sept 94]
-
- Answer: Geometry management is a key element of Motif applications for reasons
- which include, but are not limited to, the following:
-
-
- The user should be able to re-size the shell and get
- some reasonable geometry response (other than clipping).
-
- The user should be able to tailor fonts and have the
- widgets adjust accordingly. (Many people over 40 simply
- can't read small fonts without serious eye strain.)
-
- When the designers decide to change a label, the widgets
- should re-adjust accordingly.
-
- Some labels must be set dynamically and the widgets should
- re-layout accordingly.
-
- An internationalized application must work with several resource
- files, one for each supported natural language. The labels in each
- file have different lengths and the application should adjust
- accordingly.
-
-
- -----------------------------------------------------------------------------
- Subject: 50)+ What are good references for reading about geometry management?
-
- [Last modified: Oct 94]
-
- Answer: See the BOOKS topics for detailed reference information. "X Toolkit
- Intrinsics Programming Manual" (Nye & O'Reilly) contains an entire chapter on
- geometry management, as does "X Window System Toolkit" (Asente & Swick) on
- which the O'Reilly book is based. Another good reference is the discussion of
- the "geometry_manager" and "query_geometry" methods in "X Toolkit Intrinsics
- Reference Manual".
-
- "Motif Programming Manual" (Heller & Ferguson) has a chapter devoted to Motif
- Manager widgets. Finally, the widget documentation for each geometry manager
- widget typically describes its policy in detail.
-
- -----------------------------------------------------------------------------
- Subject: 51)+ Why don't my labels resize in a RowColumn widget? I have a
- RowColumn widget in my application, with several rows and columns of XmLabels.
- When I update the text in the labels, the label's width does not get updated.
-
- [Last modified: Oct 94]
-
- Answer: Make sure all the ancestor widget resize mechanisms are enabled:
-
- - on shells, set XmNallowShellResize
- - on row column, set XmNresizeWidth and XmNresizeHeight
- - on bulletin board and form, set XmNresizePolicy
-
- Also, set XmNrecomputeSize on the label itself. The shell resource is off by
- default; the others should be on by default.
-
- Thanks to Ken Lee, kenton@esd.sgi.com
-
- -----------------------------------------------------------------------------
- Subject: 52)+ Why do dialogs appear smaller under 1.2.3 and later? The same
- problem occurs with parts of a complex main window. All of my dialogs which
- were fine under 1.2.2 and earlier come up too small to work with under 1.2.3
- (or later). Why?
-
- A. Thanks to David Brooks (dbrooks@ics.com) for pointing me to Daniel
- Dardailler (daniel@x.org) who wrote this scholarly treatise:
-
- Application's Geometry Management Advanced Guidelines:
- =====================================================
- (or "How to properly manage children of already realized parent")
-
- Xt Background:
- -------------
-
- XtCreateWidget: call Initialize ;
-
- XtManageChild: if (parent realized)
- call ChangeManaged ;
- call Realize ;
-
- XtRealizeWidget: postorder ChangeManaged loop ;
- preorder Window-creation loop ;
-
-
- Creating a widget only invokes its Initialize method (its parent's
- InsertPosition method too, but that has nothing to do with GM).
- Composite widgets, by opposition to Primitive, does
- not usually get a correct size at initialization time, since their
- correct size is based on their children sizes, which do not exist yet
- at this time.
-
- Applications usually create an entire tree of managed but
- unrealized widgets and then realize their top level widget, which recursively
- realize every widgets in the tree. During the creation process, the
- managing of the unrealized widgets is a no-op (only mark them managed).
-
- When XtRealizeWidget(toplevel) happens, the change_managed methods of
- all the composite widgets in the tree are called in bottom-to-top
- order, thus giving each of them a chance to determine their own size
- based on their children *current* sizes (composite or not).
- Using the current size of the children in this situation is fine,
- since they should also be the children's preferred size, not
- yet constrained by the parents layout (post-order traversal).
-
- When one create a widget inside an already realized parent, this is
- a different story and the order of management vs realization is important.
-
- Consider a MessageBox created in a realized Frame.
- The MessageBox itself creates a bunch of managed children
- inside its Initialize method.
- If you manage the MessageBox right after its creation, the Frame
- ChangeManaged will be called (since it is realized), and its will use
- the MessageBox current size as its base for its own size.
- Unfortunately, the MessageBox ChangeManaged proc has never been called!
- so its current size is whatever the default is, usually a non-settable
- value (needed for tracking real initial size setting).
- The MessageBox ChangeManaged has not been called because its children
- were created and managed at a time where it wasn't realized.
-
- What to do ?
-
- The first solution would be to have all the ChangeManaged methods in
- Motif call XtQueryGeometry instead of using the current size if it's
- not the first time (i.e. if they're already realized).
- But this is a lot of code to change and a kind of expensive run-time
- process as it results in non-linear traversal order of the realized
- tree (looks like an O(n!) but I'm not sure).
- It's not even guaranteed that it will always work fine, since it relies on
- the assumption that the geometry queried is the same that the geometry
- asked for any manager (I mean, it might be the case, but if it's not,
- it's just more code to fix in a very "bc-sensitive" part of Xm).
-
-
- This other solution lies into the application, and is to realize a
- manager first and then to manage it.
- By realizing it, you are forcing its ChangeManaged proc to be
- called (XtRealizeWidget does that), it will get a correct size and
- this size will be used by its parent ChangeManaged when
- you'll manage the manager. By explicitly realizing the branch
- before managing its root, you are reproducing the ordering that
- is typical of most applications at startup.
-
- So the trick is:
-
- XtCreateWidget(realize_parent, MessageBox);
- XtRealizeWidget(MessageBox); /* needed */
- XtManageChild(MessageBox);
-
- and the model is:
-
- "Always explicitly realize a composite widget child of an already
- realized parent before managing it if all its children have been
- already managed"
-
- One can always realize every widget children of realized parents, that
- won't hurt, but it's useless for Primitives and Composites that
- get more children added later in the program.
- Why? because Primitives get their correct size at initialization
- time anyway and adding a child to a Composite will generate a geometry
- request and a layout that will have the same effect as if the
- ChangeManaged method had been called (well, nearly the same effect,
- that a complication I will address later).
-
- If we consider Motif, this trick is only useful for MessageBox,
- SelectionBox and subclasses, and Scale, since those are the only
- Composites that create managed children in their Initialize method and
- don't usually get additional kids from the application.
-
- However, any application that re-creates this order of actions will
- need to apply the "realize<manage" method too.
- For instance:
-
- XtCreateWidget(realize_parent, DrawingArea);
- XtRealizeWidget(DrawingArea); /* not needed */
- XtManageChild(DrawingArea);
- XtCreateWidget(DrawingArea, any_child) ;
- XtManageChild(any_child);
- but
- XtCreateWidget(realize_parent, DrawingArea);
- XtCreateWidget(DrawingArea, any_child) ;
- XtManageChild(any_child);
- XtRealizeWidget(DrawingArea); /* needed */
- XtManageChild(DrawingArea);
-
- Now this is becoming interesting: there are exceptions to the model :-)
-
- The first one is the Xt Shell widget, which has what I consider to be a
- bug, but what MIT has, until recently, always considered to be a specific
- behavior overridable by a subclass (like our VendorShell):
- the ChangeManaged method always resizes the child to its own size
- when the Shell is realized.
-
- A side effect of this behavior is that even the realized<managed trick
- won't work for direct descendant of Shell widget:
-
- XtCreateWidget(realize_shell, MessageBox);
- XtRealizeWidget(MessageBox); /* needless */
- XtManageChild(MessageBox); /* will get resized anyway */
-
- To get rid of this problem, one needs to add a regular manager
- between the Shell and the MessageBox in this case, for the sake
- of having this manager doing a request to the Shell from its
- ChangeManaged proc. This request will then be handled by the Shell
- geometry manager, not its ChangeManaged proc, and it will take into
- account the child size.
- Note that we could also change our VendorShell ChangeManaged code to not
- systematically envelop the Xt Shell ChangeManaged class method, and
- check for the already realized case, but I would rather wait
- for an Xt fix instead (I'm working on it).
-
- If you broader the scope of the Xt Shell situation, you find that there are
- also some resources in Xm that come into effect upon geometry request
- reception but are not used in the ChangeManaged method.
-
- Take the PanedWindow constraint resource XmNallowResize for instance,
- which controls the validity of a geometry request made by a PW child.
-
- If you do:
-
- XtCreateWidget(realize_shell, PanedWindow);
- XtManageChild(PanedWindow);
-
- XtCreateWidget(PanedWindow, button);
- XtManageChild(button);
-
- that works fine since the ChangeManaged of the PanedWindow will
- handle the insertion of the button and allowResize won't be used.
-
- But if you add a manager in this hierarchy:
-
- XtCreateWidget(realize_parent, PanedWindow);
- XtManageChild(PanedWindow);
-
- XtCreateWidget(PanedWindow, manager);
- XtManageChild(manager);
-
- XtCreateWidget(manager, button);
- XtManageChild(button);
-
- That doesn't work anymore since the button management results in
- its parent manager's ChangeManaged being called, which in turn makes a
- *request* to the PanedWindow, resulting in a No reply because
- of allowResize (set to False by default).
-
- The PanedWindow parent wouldn't have been realized that everything
- would have worked fine, since no request would have been made.
- It really depends on the early realization scheme.
-
- I think XmNresizable in Form is the only other resource to present
- this problem. There is not much to do in those cases except than
- setting the corresponding resource to True, which makes sense.
-
-
- -----------------------------------------------------------------------------
- Subject: 53) TOPIC: TEXT WIDGET
-
- -----------------------------------------------------------------------------
- Subject: 54)* How do XmTextField and a single line XmText widget differ?
-
- [Last modified: Oct 94]
-
- Answer: XmTextField is designed to be a lightweight, single line text editor.
- It does not provide as much functionality as does XmText in order to achieve
- better performance.
-
- Thanks to Kevin Till, kev@osf.org
-
- -----------------------------------------------------------------------------
- Subject: 55) Why does pressing <return> in a text widget do nothing? This
- happens using Motif 1.0 when I have a text widget inside a bulletin board (or
- form) inside a dialog shell. (In Motif 1.1 it is fixed for both text and list
- widgets.)
-
- Answer: In single line mode, pressing the <return> key usually invokes the
- activate() action, and in multi-line mode, the newline() action. However,
- whenever a widget is the child of a bulletin board widget which is the child
- of a dialog shell, the bulletin board forces all of its children to translate
- <return> to the bulletin board action Return() which is usually associated
- with the default button of the dialog. To restore the text actions of
- activate() or newline(), you need to overide the Return() action of the
- bulletin board.
-
-
- /* declarations */
- /* for a single line widget */
- char newTrans[] = "<Key>Return : activate()";
- /* for a multi line widget */
- char newTrans[] = "<Key>Return : newline()";
- XtTranslations transTable;
-
- /* in executable section */
-
- transTable = XtParseTranslationTable(newTrans);
-
- /* after creating but before managing text widget */
-
- XtOverrideTranslations(textWidget, transTable);
-
-
- -----------------------------------------------------------------------------
- Subject: 56) When I add text to a scrolling text widget, how can I get the
- new text to show?
-
- [Last modified: Sept 94]
-
- Answer: Use the (fully supported) function XmTextShowPosition:
-
- void XmTextShowPosition(w, position)
- Widget w;
- XmTextPosition position;
-
- where the position is the number of characters from the beginning of the
- buffer of the text to be displayed. If you don't know how many characters are
- in the buffer, use XmTextGetLastPosition.
-
- position = XmTextGetLastPosition(w)
-
-
- -----------------------------------------------------------------------------
- Subject: 57) Does the text widget support 16 bit character fonts?
-
-
- [Last modified: November 92]
-
- Answer: R5 has support for 16 bit character sets, and Motif 1.2 uses that.
- Neither Motif 1.0 nor 1.1 support 16 bit sets.
-
- -----------------------------------------------------------------------------
- Subject: 58) How can I stop the text widget from echoing characters typed? I
- need to turn off echo for password input.
-
- Answer: Use the XmNmodifyVerifyCallback to tell when input is received. Set
- the `doit' field in the XmTextVerifyCallbackStruct to False to stop the echo.
- (In Motif 1.0 this will cause a beep per character: Live with it, because at
- 1.1 you can turn it off.) Note that password hiding is inherently insecure in
- X - someone may have an X grab on the keyboard and be reading all characters
- typed in anyway.
-
- Another solution often proposed is to set the foreground and background
- colours to be the same, effectively hiding the text. This has a major flaw:
- someone may select the text (triple click the mouse to get the line), and then
- paste the password into say an xterm with *different* foreground and
- background colours. This immediately shows the password.
-
- -----------------------------------------------------------------------------
- END OF PART TWO
-
-